//-----------------------------------------------------------------------
// <copyright file="ICollaborateService.cs" company="Simnova LLC">
//     Copyright (c) Simnova LLC. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Simnova.Collaborate.ServiceContract.ServiceContracts
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.ServiceModel;
    using Simnova.Collaborate.ServiceContract.DataClasses;
    using System.ServiceModel.Web;

    [ServiceContract(Namespace = "http://Simnova.Collaborate")]
    public interface ICollaborateService
    {
        #region Reports
        [OperationContract]
        byte[] ExecuteReport(string report, IList<ReportParameter> reportParameters, string reportFormat);
        #endregion

        #region Feedback

        [OperationContract]
        IList<Product> GetProductsByCompany(int companyId);

        [OperationContract]
        Product GetProduct(int productId);

        [OperationContract]
        Feedback GetFeedback(int feedbackId);

        [OperationContract]
        FeedbackComment GetFeedbackCommentByFeedback(int userId, int feedbackId);

        [OperationContract]
        FeedbackRating GetFeedbackRatingByFeedback(int userId, int feedbackId);

        [OperationContract]
        FeedbackWatchList GetFeedbackWatchListByFeedback(int userId, int feedbackId);

        [OperationContract]
        FeedbackWorkaround GetFeedbackWorkaroundByFeedback(int userId, int feedbackId);

        [OperationContract]
        IList<Feedback> GetProductFeedback(int productId);
        
        [OperationContract]
        IList<Feedback> GetTopRatedProductFeedback(int productId, int quantity);
        [OperationContract]
        IList<Feedback> GetWatchListProductFeedback(int productId, int userId, int quantity);
        [OperationContract]
        IList<Feedback> GetNewestProductFeedback(int productId, int quantity);
        
        [OperationContract]
        IList<Feedback> GetProductFeedbackByUser(int productId, int userId);
        
        [OperationContract]
        IList<FeedbackWatchList> GetFeedbackWatchListByUser(int productId, int userId);

        [OperationContract]
        IList<FeedbackComment> GetFeedbackComments(int feedbackId);
        
        [OperationContract]
        IList<FeedbackRating> GetFeedbackRatings(int feedbackId);
        
        [OperationContract]
        IList<FeedbackWorkaround> GetFeedbackWorkarounds(int feedbackId);

        [OperationContract(IsOneWay = true)]
        void SaveProduct(Product product);
        
        [OperationContract(IsOneWay = true)]
        void SaveFeedback(Feedback feedback);
        
        [OperationContract(IsOneWay = true)]
        void SaveFeedbackComment(FeedbackComment feedbackComment);

        [OperationContract(IsOneWay = true)]
        void SaveFeedbackRating(FeedbackRating feedbackRating);

        [OperationContract(IsOneWay = true)]
        void SaveFeedbackWatchList(FeedbackWatchList feedbackWatchList);

        [OperationContract(IsOneWay = true)]
        void DeleteFeedbackWatchList(FeedbackWatchList feedbackWatchList);

        [OperationContract(IsOneWay = true)]
        void SaveFeedbackWorkaround(FeedbackWorkaround feedbackWorkaround);

        #endregion

        #region Company

        [OperationContract]
        Company GetCompany(int companyId);

        [OperationContract(IsOneWay = true)]
        void SaveCompany(Company company, int userId);

        [OperationContract]
        IList<Company> GetCompanies();

        #endregion

        #region Project

        [OperationContract]
        Project GetProject(int projectId);

        [OperationContract(IsOneWay = true)]
        void SaveProject(Project project);

        [OperationContract]
        IList<Project> GetProjectsByCompany(int companyId);

        #endregion

        #region Task

        [OperationContract]
        Task GetTask(int taskId);

        [OperationContract(IsOneWay = true)]
        void SaveTask(Task task);

        [OperationContract]
        IList<Task> GetTasksByProject(int projectId);

        [OperationContract]
        IList<Task> GetTasksByUser(int userId);        

        #endregion

        #region User

        [OperationContract]
        User GetUserById(int userId);

        [OperationContract]
        User GetUser(string emailAddress, string password);

        [OperationContract(IsOneWay = true)]
        void SaveUser(User user);

        [OperationContract]
        IList<CompanyUser> GetCompanyUsersByCompany(int companyId);

        [OperationContract]
        IList<User> GetUsers();

        [OperationContract]
        IList<Company> GetCompaniesByAdministrator(int userId);

        [OperationContract]
        IList<Company> GetCompaniesByUser(int userId);

        [OperationContract]
        IList<Role> GetRolesByUserCompany(int userId, int companyId);

        [OperationContract(IsOneWay = true)]
        void SaveUserRole(UserRole userRole);

        [OperationContract(IsOneWay = true)]
        void SaveActivityType(ActivityType activityType);

        [OperationContract]
        IList<ActivityType> GetActivityTypesByRole(int roleId);

        [OperationContract]
        IList<Role> GetRolesByCompany(int companyId);

        [OperationContract(IsOneWay = true)]
        void SaveRole(Role role);

        #endregion
        
        #region TimeLog

        [OperationContract]
        IList<TimeLog> GetTimeLogByUser(int userId);

        [OperationContract]
        TimeLog GetCurrentTimeLog(int userId);

        [OperationContract]
        void SaveTimeLog(TimeLog timeLog);

        [OperationContract]
        void DeleteTimeLog(TimeLog timeLog);

        #endregion
    }
}
